#ifndef __HALALGRSA_H__
#define __HALALGRSA_H__

#define MAX_RSA_MODULUS_LEN		256 
#define MAX_RSA_PRIME_LEN		128 

typedef struct 
{ 
	UINT32 AlgID; 
	UINT32 BitLen; //length in bits of modulus 
	UINT8 Modulus[MAX_RSA_MODULUS_LEN]; //modulus
	UINT8 PublicExponent[MAX_RSA_MODULUS_LEN]; //public exponent 
	UINT8 Exponent[MAX_RSA_MODULUS_LEN]; //private exponent
	UINT8 Prime1[MAX_RSA_PRIME_LEN]; 
	UINT8 Prime2[MAX_RSA_PRIME_LEN]; //prime factors */ 
	UINT8 Prime1Exponent[MAX_RSA_PRIME_LEN]; //exponents for CRT
	UINT8 Prime2Exponent[MAX_RSA_PRIME_LEN]; 
	UINT8 Coefficient[MAX_RSA_PRIME_LEN]; //CRT coefficient
}RsaKeyPair;

	extern UINT32 HalAlgRSA_Init(UINT16 BitLen);
	extern UINT32 HalAlgRSA_GenKeyPair(UINT32 Exp);

	extern UINT32 HalAlgRSA_Public_Update(UINT8 *pInBuf, UINT32 nLen, UINT8 *pOutBuf); 
	extern UINT32 HalAlgRSA_Private_Update(UINT8 *pInBuf, UINT32 nLen, UINT8 *pOutBuf); 

	extern UINT32 HalAlgRSA_Final(void);

	extern void *HalAlgRSA_GetKeyPairContext(UINT16 *pLen);
	
#endif
